<!-- ui:
平台，自适应大小，超出隐藏。
有多个桌面项，可拖动。 
1.桌面项数据列表 -->

<div class="body" #body>
        
<!-- 桌面项列表 -->
<div class="items" [cdkContextMenuTriggerFor]="desktop_menu" (cdkContextMenuOpened)="contextMenuOpened($event)"  > 
 <app-selection-box-cmp (itemsSelected)="handleItemsSelected($event)"> 
        <app-desktop-item-cmp class="item"  #desktop_item [appSelectable]="item"
        *ngFor="let item of desktopItems"  
        cdkDrag 
        cdkDragBoundary=".body"
        [cdkDragFreeDragPosition]="item.position" 
        [data]="item"
        (cdkDragStarted)="onDragStarted($event,item)"
        (cdkDragMoved)="onDragMoved($event,item)"
        (cdkDragEnded)="onDragEnded($event,item)" 
        (onRemove)="removeItem($event)"
        (click)="clickItem($event,item); $event.stopPropagation(); "
         [ngClass]="{ 'selected': itemSelected(item) }"  
        ></app-desktop-item-cmp>
</app-selection-box-cmp>
</div>
 
<!-- 窗口区域 -->
<app-window-container-cmp></app-window-container-cmp>
</div>

<ng-template #desktop_menu>
        <div class="menu" cdkMenu> 
          <button class="menu-item"  cdkMenuItem (click)="createFolder()" >新建文件夹</button>
          <button class="menu-item"  cdkMenuItem [cdkMenuTriggerFor]="new_doc">新建文件
                <span>
                        <svg viewBox="0 0 5 10" focusable="false" aria-hidden="true" class="mat-mdc-menu-submenu-icon"><polygon points="0,0 5,5 0,10"></polygon></svg>
                </span>
          </button>  
          <button class="menu-item"  cdkMenuItem *ngIf="isCanPasteFlag" (click)="paste()"  >粘贴</button>     
          <button class="menu-item"  cdkMenuItem (click)="load()"  >刷新</button>     
          <button class="menu-item"  cdkMenuItem  *ngFor="let item of ext_operations" (click)="ext_operation_execute(item)" >{{item.name}}</button>
        </div>
</ng-template>

<ng-template #new_doc>
        <div class="menu" cdkMenu>
          <button class="menu-item"  cdkMenuItem  *ngFor="let item of createFile_templates" (click)="createFile(item)" >{{item.name}}</button> 
        </div>
</ng-template>